1. Field of the Invention
The present invention relates to a data processor and, in particular, to a technique for commonly processing bit streams of different bit array sequences.
2. Description of the Related Art
Digital image data has come to be regularly used in recent years. Due to the demand for saving capacity in a storage medium to store image data and reducing time to transmit image data, image data is usually compressed by an encoding at a time of transmission and storage, and decoded when reproduced.
As a compression standard of image data, JPEG (Joint Photographic Experts Group) is well known. An image format based on JPEG is widely used in Web pages, digital cameras and DVDs (Digital Versatile Disk).
To reproduce JPEG compressed data, a bit stream, which is compressed data, is read out from a storage medium to retrieve a Huffman code therefrom. The retrieved Huffman code is input to a decoder and decoded by the decoder (see Japanese Unexamined Patent Application Publication No. Hei-11-261424).
FIG. 13 is a view showing a JPEG format. As shown in FIG. 13, a JPEG stream is formed by a plurality of 8 bits bit blocks, with one or more 8 bits fixed length data bit blocks included at the beginning followed by a bit block of variable length (VLC) part. The number of the bit blocks in the VLC part is one or more corresponding to the code length of the VLC. At the end of the last bit block in the VLC part, a padding bit is included, which is an invalid bit inserted to align the beginning of the fixed length data bit block that follows the variable length data to 8 bits boundary of the stream. The number of the padding bits is 0 to 7.
Other than the JPEG format, PNG (Portable Network Graphics) has come to be widely used in recent years. The structure of PNG is quite similar to the JPEG format shown in FIG. 13.
These two kinds of the image formats are employed to HD DVD (High Definition DVD) and Blue-ray Disc, which are the standards for next generation DVD, and the standards allow both formats to be combined.
With such background, a reproducing apparatus that supports both JPEG and PNG image formats is required. In such reproducing apparatus, in light of similarities between JPEG and PNG formats, it is desired to reduce the size of the reproducing apparatus and to reduce the manufacturing cost by reproducing images of both JPEG and PNG formats by a single reproducing apparatus.
For example as with the VLC part in the JPEG bit stream, a VLC part of PNG is also a Huffman code, thus the encoding method for the VLC part of PNG and that of JPEG is basically the same. Therefore, an apparatus for commonly processing the VLC parts in JPEG and PNG bit stream can be considered.
By the way as shown in FIG. 14, bit sequences in the blocks of 8 bits fixed length data of the JPEG and PNG bit streams are the same, however the bit sequences in the VLC blocks are different.
Therefore, to joint apparatuses for processing the VLC parts in the bit streams of JPEG and PNG, the bit array sequences of both the VLC blocks need to be aligned before being input to a VLC processor. However, it has now been discovered that to achieve this, a control for reading out a bit stream becomes complicated.